Optimal. Leaf size=82 \[ a x+\frac {3 b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {3 b \cos (c+d x)}{2 d}+\frac {a \cot (c+d x)}{d}-\frac {b \cos (c+d x) \cot ^2(c+d x)}{2 d}-\frac {a \cot ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 7, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {2801, 2672,
294, 327, 212, 3554, 8} \begin {gather*} -\frac {a \cot ^3(c+d x)}{3 d}+\frac {a \cot (c+d x)}{d}+a x-\frac {3 b \cos (c+d x)}{2 d}-\frac {b \cos (c+d x) \cot ^2(c+d x)}{2 d}+\frac {3 b \tanh ^{-1}(\cos (c+d x))}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 212
Rule 294
Rule 327
Rule 2672
Rule 2801
Rule 3554
Rubi steps
\begin {align*} \int \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx &=\int \left (b \cos (c+d x) \cot ^3(c+d x)+a \cot ^4(c+d x)\right ) \, dx\\ &=a \int \cot ^4(c+d x) \, dx+b \int \cos (c+d x) \cot ^3(c+d x) \, dx\\ &=-\frac {a \cot ^3(c+d x)}{3 d}-a \int \cot ^2(c+d x) \, dx-\frac {b \text {Subst}\left (\int \frac {x^4}{\left (1-x^2\right )^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {a \cot (c+d x)}{d}-\frac {b \cos (c+d x) \cot ^2(c+d x)}{2 d}-\frac {a \cot ^3(c+d x)}{3 d}+a \int 1 \, dx+\frac {(3 b) \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{2 d}\\ &=a x-\frac {3 b \cos (c+d x)}{2 d}+\frac {a \cot (c+d x)}{d}-\frac {b \cos (c+d x) \cot ^2(c+d x)}{2 d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {(3 b) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{2 d}\\ &=a x+\frac {3 b \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {3 b \cos (c+d x)}{2 d}+\frac {a \cot (c+d x)}{d}-\frac {b \cos (c+d x) \cot ^2(c+d x)}{2 d}-\frac {a \cot ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 0.03, size = 125, normalized size = 1.52 \begin {gather*} -\frac {b \cos (c+d x)}{d}-\frac {b \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {a \cot ^3(c+d x) \, _2F_1\left (-\frac {3}{2},1;-\frac {1}{2};-\tan ^2(c+d x)\right )}{3 d}+\frac {3 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}-\frac {3 b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {b \sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.17, size = 86, normalized size = 1.05
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )+b \left (-\frac {\cos ^{5}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{2}-\frac {3 \cos \left (d x +c \right )}{2}-\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )}{d}\) | \(86\) |
default | \(\frac {a \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )+b \left (-\frac {\cos ^{5}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{2}-\frac {3 \cos \left (d x +c \right )}{2}-\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )}{d}\) | \(86\) |
risch | \(a x -\frac {b \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {b \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {12 i a \,{\mathrm e}^{4 i \left (d x +c \right )}+3 b \,{\mathrm e}^{5 i \left (d x +c \right )}-12 i a \,{\mathrm e}^{2 i \left (d x +c \right )}+8 i a -3 b \,{\mathrm e}^{i \left (d x +c \right )}}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}\) | \(144\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.68, size = 92, normalized size = 1.12 \begin {gather*} \frac {4 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a + 3 \, b {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - 4 \, \cos \left (d x + c\right ) + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 160 vs.
\(2 (74) = 148\).
time = 0.38, size = 160, normalized size = 1.95 \begin {gather*} \frac {16 \, a \cos \left (d x + c\right )^{3} + 9 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 9 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 12 \, a \cos \left (d x + c\right ) + 6 \, {\left (2 \, a d x \cos \left (d x + c\right )^{2} - 2 \, b \cos \left (d x + c\right )^{3} - 2 \, a d x + 3 \, b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right ) \cot ^{4}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 9.99, size = 141, normalized size = 1.72 \begin {gather*} \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, {\left (d x + c\right )} a - 36 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {48 \, b}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + \frac {66 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.29, size = 225, normalized size = 2.74 \begin {gather*} \frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {-5\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+17\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {14\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a}{3}}{d\,\left (8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}-\frac {5\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {3\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d}-\frac {2\,a\,\mathrm {atan}\left (\frac {4\,a^2}{4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+6\,b\,a}-\frac {6\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+6\,b\,a}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________